package com.pkk.cloud.support.admin.mybatis.resource;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pkk.cloud.support.admin.bo.RoleClientCateAndMenuResourceSimpeBo;
import com.pkk.cloud.support.admin.bo.RoleClientResourceSimpeBo;
import com.pkk.cloud.support.admin.dto.req.resources.OauthResourcePidReqDto;
import com.pkk.cloud.support.admin.dto.resp.resources.OauthResourceSimpleRespDto;
import com.pkk.cloud.support.admin.entity.resource.PenguinSysResource;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface PenguinSysResourceMapper extends BaseMapper<PenguinSysResource> {

  /**
   * @Description: 依据服务名称获取资源信息
   * @Param: serverName:服务名称
   * @return: java.util.List<com.pkk.cloud.support.admin.entity.resource.PenguinSysResource>
   * @Author: peikunkun
   * @Date: 2020/3/16 0016 下午 5:53
   */
  List<PenguinSysResource> findSysResourceByServerName(HashMap<String, Object> param);

  /**
   * @Description: 根据服务查询按钮资源
   * @Param: serverId
   * @Param userId
   * @return: java.util.List<java.lang.String>
   * @Author: peikunkun
   * @Date: 2020/3/26 0026 下午 2:24
   */
  List<String> findSysResourceButtonByServerName(HashMap<String, Object> param);

  /**
   * @Description: 依据客户端id查询客户端资源信息
   * @Param: clientId
   * @return: java.util.List<com.pkk.cloud.support.admin.bo.RoleClientResourceSimpeBo>
   * @Author: peikunkun
   * @Date: 2020/4/10 0010 上午 11:18
   */
  List<RoleClientResourceSimpeBo> findClientAllResourceByClientId(String clientId);

  /**
   * @Description: 获取角色id查询角色资源id
   * @Param: roleId
   * @return: java.util.List<java.lang.Long>
   * @Author: peikunkun
   * @Date: 2020/4/10 0010 上午 11:40
   */
  Set<Long> findRoleResourceIdByRoleId(Long roleId);

  /**
   * @Description: 获取资源信息id依据客户端id
   * @Param: clientId
   * @return: java.util.Set<java.lang.Long>
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 12:44
   */
  Set<Long> findSysResourceIdsByOwnClientId(String clientId);

  /**
   * @Description: 依据客户端id查询客户端资源信息[获取菜单与分类]
   * @Param: clientId
   * @return: java.util.List<com.pkk.cloud.support.admin.bo.RoleClientCateAndMenuResourceSimpeBo>
   * @Author: peikunkun
   * @Date: 2020/4/10 0010 上午 11:18
   */
  List<RoleClientCateAndMenuResourceSimpeBo> findClientCateAndMenuResourceByClientId(String clientId);

  /**
   * @Description: 获取资源信息依据父id
   * @Param: request
   * @Author: peikunkun
   * @Date: 2020/4/11 0011 下午 7:41
   */
  List<OauthResourceSimpleRespDto> getResourceByPid(OauthResourcePidReqDto body);

  /**
   * @Description: 获取资源信息
   * @Param: body
   * @return: com.pkk.cloud.support.admin.dto.resp.resources.OauthResourceSimpleRespDto
   * @Author: peikunkun
   * @Date: 2020/4/18 0018 下午 3:45
   */
  OauthResourceSimpleRespDto getResourceById(Long resourceId);
}